import request from '@/config/axios'

// 学校 VO
export interface SchoolVO {
  id: number // 主键
  name: string // 学校名称
  mobile: string // 学校电话
}

// 学校 API
export const SchoolApi = {
  // 查询学校分页
  getSchoolPage: async (params: any) => {
    return await request.get({ url: `/business/school/page`, params })
  },

  // 查询学校详情
  getSchool: async (id: number) => {
    return await request.get({ url: `/business/school/get?id=` + id })
  },

  // 查询学校详情
  getSchoolList: async () => {
    return await request.get({ url: `/business/school/list` })
  },

  // 新增学校
  createSchool: async (data: SchoolVO) => {
    return await request.post({ url: `/business/school/create`, data })
  },

  // 修改学校
  updateSchool: async (data: SchoolVO) => {
    return await request.put({ url: `/business/school/update`, data })
  },

  // 删除学校
  deleteSchool: async (id: number) => {
    return await request.delete({ url: `/business/school/delete?id=` + id })
  },

  // 导出学校 Excel
  exportSchool: async (params) => {
    return await request.download({ url: `/business/school/export-excel`, params })
  },
}
